package com.mi9688.lambda;

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

public class Test03 {
	public static void main(String [] args){
		List<String> names=Arrays.asList("小明","小黑","小红");
		

		for(String name:names){
			System.out.println(name);
		}
		

		names.forEach(new Consumer<String>(){
			@Override
			public void accept(String name) {
				System.out.println(name);
			}
			
		});
		
		//Lambda
		names.forEach(System.out::println);
		
	}
}
